package client;

import gui.common.msg.SysMessage;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

import data.User;


public class CallBackImp extends UnicastRemoteObject implements CallBack {

	private static final long serialVersionUID = 1L;

	private ChatClient thisClient;

	public CallBackImp(ChatClient client) throws RemoteException {
		thisClient = (ChatClient) client;
	}
	public void addMessage(String from, String message) throws RemoteException {
		thisClient.getMessageBox().append("<" + from + ">" + message + "\n");
	}

	public void quitMessage(String from) throws RemoteException {
		thisClient.getMessageBox().append(from + " has left.\n");
	}

	public void joinedMessage(String from) throws RemoteException {
		thisClient.getMessageBox().append(from + " has joined.\n");
	}

	
}
